import 'package:fish_redux/fish_redux.dart';
import '../../../app_files.dart';

class BannerComponentState implements Cloneable<BannerComponentState> {
  List<BannerModel> list = [];

  @override
  BannerComponentState clone() {
    return BannerComponentState()..list = list;
  }
}

BannerComponentState initState(Map<String, dynamic> args) {
  return BannerComponentState();
}

///滚动图model
class BannerModel {
  final String title;
  final String itemId;
  final String imgUrl;
  final String url;

  const BannerModel({
    this.title,
    this.itemId,
    this.imgUrl,
    this.url,
  });

  static BannerModel fromJson(dynamic json) {
    return BannerModel(
      title: CommonUtils.checkNullToString(json['title']),
      itemId: CommonUtils.checkNullToString(json['id']),
      imgUrl: CommonUtils.checkNullToString(json['bannerUrl']),
      url: CommonUtils.checkNullToString(json['contentUrl']),
    );
  }
}